package com.test.cert;

import com.test.utils.Base64Utils;
import org.apache.shiro.codec.Base64;

import java.io.ByteArrayOutputStream;
import java.io.FileInputStream;

public class CertMain {

    public static void main(String[] args) {
        FileInputStream fis = null;
        ByteArrayOutputStream bos = null;
        try {
            fis = new FileInputStream("E:\\data\\desktop\\客户协议图片\\e.png");
            bos = new ByteArrayOutputStream();
            byte[] buff = new byte[4096];
            int len = 0;
            while((len = fis.read(buff)) > 0) {
                bos.write(buff, 0, len);
            }
            System.out.println(Base64.encodeToString(bos.toByteArray()));
//            System.out.println(Base64Utils.encode(bos.toByteArray()));
            System.out.println(bos.toByteArray().length);
        } catch (Exception e) {

        }
    }
}
